# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
# version must be kept in sync with libqalculate
pkgname=qalculate-qt
pkgver=5.2.0
pkgrel=0
pkgdesc="Multi-purpose desktop calculator - Qt version"
url="https://github.com/Qalculate/qalculate-qt"
# qmake is broken on riscv64
arch="all !riscv64"
license="GPL-2.0-or-later"
depends="gnuplot"
makedepends="qt6-qtbase-dev qt6-qttools-dev libqalculate-dev"
subpackages="$pkgname-doc"
source="https://github.com/Qalculate/qalculate-qt/releases/download/v$pkgver/qalculate-qt-$pkgver.tar.gz"
options="!check" # no test suite

build() {
	export CFLAGS="$CFLAGS -flto=auto"
	export CXXFLAGS="$CXXFLAGS -flto=auto"
	qmake6 PREFIX=/usr
	make
}

check() {
	make check
}

package() {
	make INSTALL_ROOT="$pkgdir" install
}

sha512sums="
a25dbe16f29ad047f42c601729fdc1e79cd12f526975b358c1838085513c8fb7d70c313e258876b465a871eea0804ab6ea56e9c34eb6d9c01784a4f67f6cc6af  qalculate-qt-5.2.0.tar.gz
"
